/***************************************
 2010-5-5
****************************************/
package com.happy.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.search.annotations.DocumentId;
import org.hibernate.search.annotations.Field;
import org.hibernate.search.annotations.Index;
import org.hibernate.search.annotations.Indexed;



@Entity
@Table(name = "Ariticle", catalog = "sec", uniqueConstraints = {})
@Indexed(index="Ariticle")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class Ariticle {
	private long id;
	private String title;
	private String content;
	private UserInfo user_info;
	private String status;
	/**默认无参构造函数**/
	public Ariticle() {
	}
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name = "id", unique = true, nullable = false, insertable = true, updatable = true)
	@DocumentId
	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	@Column(name = "title", unique = false, nullable = false, insertable = true, updatable = true, length = 50)
	@Field(name = "title", index = Index.TOKENIZED, store =org.hibernate.search.annotations.Store.YES)   
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	@Column(name = "content", unique = false, nullable = false, insertable = true, updatable = true, length = 1000)
	@Field(name = "content", index = Index.TOKENIZED,store =org.hibernate.search.annotations.Store.YES)
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	@ManyToOne
	@JoinColumn(name = "user_id", nullable = false)
	public UserInfo getUser_info() {
		return user_info;
	}
	public void setUser_info(UserInfo userInfo) {
		user_info = userInfo;
	}
	@Column(name = "status", unique = false, nullable = false, insertable = true, updatable = true, length = 2)
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	
	
}
